package com.utilviet.baovn.objects;

import android.content.Context;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.WebView;

/**
 * Created by leanhtai on 6/24/15.
 */
public class BaseWebView extends WebView {
    public IBaseWebView mIWebView = null;
    private final Handler handler = new Handler();
    private float mCurX = 0;
    private float mCurY = 0;

    public BaseWebView(Context context) {
        super(context);
    }

    public BaseWebView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public BaseWebView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        setOnLongClickListener(new OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                if (mIWebView != null) {
                    mIWebView.webViewDidLongPress(BaseWebView.this);
                }

                return false;
            }
        });
    }
}
